
<div class="row">
    <div class="col-xs-12 col-sm-6 col-md-5 col-lg-6">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="1" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">
                            <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-title" class="form-control" name="row[title]" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-desc" class="form-control" name="row[desc]" type="text">
                                        </div>
                                    </div>
                                    <!--
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-type" class="form-control" name="row[type]" type="text">
                                        </div>
                                    </div>
                                    -->
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <div class="input-group">
                                                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
                                                <div class="input-group-addon no-border no-padding">
                                                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                                </div>
                                                <span class="msg-box n-right" for="c-image"></span>
                                            </div>
                                            <ul class="row list-inline faupload-preview" id="p-image"></ul>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <div class="radio">
                                                {foreach name="statusList" item="vo"}
                                                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
                                                {/foreach}
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('发送')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <div class="radio">
                                                {foreach name="isSendList" item="vo"}
                                                <label for="row[status]-{$key}"><input id="row[is_send]-{$key}" name="row[is_send]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
                                                {/foreach}
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('类型')}:</label>
                                        <div class="col-xs-12 col-sm-8">

                                            <select  id="c-send_type" class="form-control selectpicker" name="row[send_type]">
                                                {foreach name="sendTypeList" item="vo"}
                                                <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                                                {/foreach}
                                            </select>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('用户')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <textarea class="form-control" id="user_ids" name="row[user_ids]" placeholder="请输入用户ID空格或回车间隔" ></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2"> </label>
                                        <div class="col-xs-12 col-sm-8">
                                            <a onclick="aa()" id="paihangbang" class="btn btn-xs btn-success btn-editone">排行榜</a>
                                           <!-- <a onclick="bb()" id="yuepaihangbang" class="btn btn-xs btn-success btn-editone">月排行榜</a> -->
                                            <a onclick="cc()" id="zhoupaihangbang" class="btn btn-xs btn-success btn-editone">周排行榜</a>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-xs-12 col-sm-2">{:__('Reward')}:</label>
                                        <div class="col-xs-12 col-sm-8" id="div-content">
                                            <div onclick="jia()" id="jia-div" style="cursor:pointer;height: 30px;width:40px;background: #337ab7;line-height: 30px;color:white;text-align: center;border-radius:5px; "> + </div>
                                            <!--
                                            <div class="input-group"  >
                                                <span class="input-group-addon"> 赠送：</span>
                                                <select class="form-control" name="row[reward][]">
                                                    <?php foreach($data_list as $k1=>$val1): ?>
                                                    <option value="<?=$k1?>"><?=$val1?></option>
                                                    <?php endforeach; ?>
                                                </select>
                                                <span class="input-group-addon">数量：</span>
                                                <input   name="row[num][]" type="number" min="1" value="1" class="form-control">
                                                <span onclick="jian(this)" title="删除" class="input-group-addon" style="background: #777;color: white; cursor:pointer;">-</span>
                                            </div>
                                            -->
                                        </div>
                                    </div>

                                    <div class="form-group layer-footer">
                                        <label class="control-label col-xs-12 col-sm-2"></label>
                                        <div class="col-xs-12 col-sm-8">
                                            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
                                            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                                        </div>
                                    </div>
                                </form>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="col-xs-12 col-sm-6 col-md-7 col-lg-6" id="table2-div" style="display: none">

        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="myTabContent2" class="tab-content">
                    <div class="tab-pane fade active in" id="two">
                        <div class="widget-body no-padding">
                            <div id="toolbar2" class="toolbar">
                                {:build_toolbar('refresh')}

                                <a class="btn btn-info" class="getUserId" id="aabb2">获取用户ID</a>
                            </div>
                            <table id="table2" class="table table-striped table-bordered table-hover" width="100%">
                                <caption>游戏排行榜</caption>

                            </table>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="col-xs-12 col-sm-6 col-md-7 col-lg-6" id="table3-div" style="display: none">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="myTabContent3" class="tab-content">
                    <div class="tab-pane fade active in" id="three">
                        <div class="widget-body no-padding">
                            <div id="toolbar3" class="toolbar">
                                {:build_toolbar('refresh')}
                                <a class="btn btn-info" class="getUserId" id="aabb3">获取用户ID</a>
                            </div>
                            <table id="table3" class="table table-striped table-bordered table-hover" width="100%">
                                <caption>游戏月排行榜</caption>
                            </table>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="col-xs-12 col-sm-6 col-md-7 col-lg-6" id="table4-div" style="display: none">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="myTabContent4" class="tab-content">
                    <div class="tab-pane fade active in" id="four">
                        <div class="widget-body no-padding">
                            <div id="toolbar4" class="toolbar">
                                {:build_toolbar('refresh')}
                                <a class="btn btn-info" class="getUserId" id="aabb4">获取用户ID</a>
                            </div>
                            <table id="table4" class="table table-striped table-bordered table-hover" width="100%">
                                <caption>游戏周排行榜</caption>
                            </table>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

</div>


<script>
    function jia() {
        console.log(111);
        var html =`
        <div class="input-group">
                <span class="input-group-addon">赠送： </span>
                <select class="form-control" name="row[reward][]">
                    <?php foreach($data_list as $k1=>$val1): ?>
                        <option value="<?=$k1?>"><?=$val1?></option>
                    <?php endforeach; ?>
                </select>
                <span class="input-group-addon">数量：</span>
                <input   name="row[num][]" type="number" min="1" value="1" class="form-control">
                <span onclick="jian(this)" title="删除" class="input-group-addon" style="background: #777;color: white; cursor:pointer;">-</span>
            </div>
        `;
        $("#div-content").append(html);
    }

    function jian(obj) {
        $(obj).parent().remove();
    }

    function getDate(obj) {
        var month = $("#c-month").val();
        console.log(month);
        if(month){
            $.post("sign/getDate", {month:month}, function (tem) {
                console.log(tem);
                $("#date-div").html(tem);
            }, 'html')
        }

    }

    function aa() {
        $("#table2-div").show();
        $("#table3-div").hide();
        $("#table4-div").hide();
    }
    function bb() {
        $("#table2-div").hide();
        $("#table3-div").show();
        $("#table4-div").hide();
    }
    function cc() {
        $("#table2-div").hide();
        $("#table3-div").hide();
        $("#table4-div").show();
    }


</script>
